package com.zero.manage.web.components.service;

import com.zero.manage.web.components.base.IBase;
import com.zero.manage.web.components.dto.LoginDto;
import com.zero.manage.web.components.dto.SysUserDto;
import com.zero.manage.web.components.entity.rbac.SysUserEntity;
import com.zero.manage.web.components.query.SysOnLineUserQuery;
import com.zero.manage.web.components.query.SysUserQuery;
import io.gitee.zerowsh.enums.ToolEnums;
import io.gitee.zerowsh.util.PageResult;
import io.gitee.zerowsh.util.PublicResult;
import org.springframework.stereotype.Repository;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
import java.util.Map;


@Repository
public interface SysUserService extends IBase<SysUserEntity, String, SysUserQuery> {
    PublicResult login(LoginDto loginDto, HttpServletResponse response);

    PublicResult captcha();

    PublicResult logout();

    SysUserDto getUserInfoByName(String name);

    String getPasswordByName(String name);

    Map<String, String> getNickNameAndIdByName(String name);

    List<String> getPowerList(String name);

    PublicResult initFrontEndInfo();

    PublicResult updateState(String id, ToolEnums.StateEnums state);

    void updateLoginTime(String name);

    PublicResult resetPassword(String userId, String newPassword);

    PublicResult updatePassword(String oldPassword, String newPassword);

    PageResult<List<SysUserEntity>> onlineUserPage(SysOnLineUserQuery query);

    PublicResult forcedOffline(String name);

    PublicResult importInfo(MultipartFile file) throws IOException;

    void exportInfo(HttpServletResponse response, SysUserQuery query) throws IOException;
}
